package cn.ray.springframework.context.support;

import cn.ray.springframework.beans.factory.support.DefaultListableBeanFactory;
import cn.ray.springframework.beans.factory.xml.XmlBeanDefinitionReader;

//对abstractRefreshableApplicationContext的增强
//使用xml配置文件读入配置的方式
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{
    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader=new XmlBeanDefinitionReader(beanFactory,this);
        String[]configurationLocations=getConfigLocations();
        if(configurationLocations!=null){
            beanDefinitionReader.loadBeanDefinitions(configurationLocations);
        }
    }

    //从入口上下文类 拿到配置的地址描述
    protected abstract String[] getConfigLocations();
}
